home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 13 / 013.d81 / dos #39 < prev    next >
Text File  |  2022-08-26  |  4KB  |  217 lines

  1. ======================================
  2.       DOS & Don'ts -- Part 39
  3.  
  4.       by James Gregory Weiler
  5.  
  6. ======================================
  7.  
  8. Map 7: Side sector
  9.  
  10. byte    description
  11. ----    ------------
  12. 0-1     Track & block of next side
  13.         sector.
  14. 1       If this is the last side
  15.         sector, byte of the last used
  16.         data block pointer.
  17. 2       Side sector number.
  18. 3       Record length.
  19. 4-5     Track/block of side sector 0.
  20. 6-7     Track/block of side sector 1.
  21. 8-9     Track/block of side sector 2.
  22. 10-11   Track/block of side sector 3.
  23. 12-13   Track/block of side sector 4.
  24. 14-15   Track/block of side sector 5.
  25. 16-255  Track/block links to 120
  26.         data blocks.
  27.  
  28. ======================================
  29.  
  30.   Bytes 0 and 1 of a side sector are
  31.  
  32. our old friends, links.  They connect
  33.  
  34. each side sector to the next side
  35.  
  36. sector.  If there is no next side
  37.  
  38. sector, then byte 0 contains a zero
  39.  
  40. and byte 1 contains the number of the
  41.  
  42. byte of the link to the last assigned
  43.  
  44. data block. (Don't despair, I'll
  45.  
  46. explain that gibberish.)  What it
  47.  
  48. means in plain English is that if only
  49.  
  50. one data block has been used, byte one
  51.  
  52. will contain a value of 17.  Byte 17
  53.  
  54. is where we find a link to that one
  55.  
  56. data block.  I'll talk about data
  57.  
  58. block links in a moment.
  59.  
  60.   Byte 2 contains the number of THIS
  61.  
  62. side sector.  You can have up to six
  63.  
  64. side sectors in a relative file.
  65.  
  66. At 120 data blocks per side sector,
  67.  
  68. that gives you a data capacity of 720
  69.  
  70. blocks.  Obviously a file that large
  71.  
  72. would never fit on a 1541 disk with
  73.  
  74. only 664 blocks available in the first
  75.  
  76. place.
  77.  
  78.   Byte 3 contains the record size.
  79.  
  80. This should match the record size
  81.  
  82. found in the directory entry.
  83.  
  84.   Bytes 4 through 15 contain the
  85.  
  86. disk addresses of all of the side
  87.  
  88. sectors for this file.  This is the
  89.  
  90. universal link you saw in the chart
  91.  
  92. in Part 38.
  93.  
  94.   And now, the bytes you've been
  95.  
  96. waiting for... the data block links.
  97.  
  98. Each pair of bytes from 16 to 255
  99.  
  100. is a data block link.  Bytes 16-17
  101.  
  102. link to block 1.  Bytes 18-19 link
  103.  
  104. to block 2.  Etc.
  105.  
  106.   The first link (the one at 16-17)
  107.  
  108. holds the same value as the data block
  109.  
  110. link found in the directory entry.
  111.  
  112. After all, they both point to the
  113.  
  114. first data block.  The second link
  115.  
  116. has the same value as the file link
  117.  
  118. at the start of data block 1 -- they
  119.  
  120. both point to data block 2.
  121.  
  122.   In essence, the data block links
  123.  
  124. that you find in side sectors are
  125.  
  126. the spittin' image of the links you
  127.  
  128. find if you trace through the data
  129.  
  130. blocks' file links.  And that sameness
  131.  
  132. is what enables DOS to find the data
  133.  
  134. block it wants quickly via side
  135.  
  136. sectors.
  137.  
  138.  
  139.  Now, you know we never give you this
  140.  
  141. much technical information without
  142.  
  143. giving you some way to use it, so
  144.  
  145. we have a little demo program for
  146.  
  147. you.  It is called Q&G UNSCRATCHER and
  148.  
  149. it is on Side 2 of this issue.  This
  150.  
  151. program is designed to search through
  152.  
  153. the directory looking for scratched
  154.  
  155. files.  If you would like to unscratch
  156.  
  157. one of the files, then the program
  158.  
  159. will attempt to do so.  If something
  160.  
  161. has been saved over any part of the
  162.  
  163. original file, then the unscratch will
  164.  
  165. fail and the program will tell you so.
  166.  
  167. If all of the file can be found and
  168.  
  169. saved, then the program proceeds to
  170.  
  171. unscratch the file.  To use this
  172.  
  173. program, you need two files.  These
  174.  
  175. files are:
  176.  
  177.        Q&G UNSCRATCHER
  178.        INPUT 1-255.O
  179.  
  180. First, you will be given a list of all
  181.  
  182. of the scratched files on the disk.
  183.  
  184. Then you will be asked for which file
  185.  
  186. to unscratch.  The program will then
  187.  
  188. search for the name that you input.
  189.  
  190. The program uses a type of wildcard
  191.  
  192. when searching the directory. For
  193.  
  194. example, if you input the name CAT,
  195.  
  196. then the program will find the first
  197.  
  198. occurrence of a name with the first
  199.  
  200. three letters C-A-T.  In other words,
  201.  
  202. the program will find names like
  203.  
  204. CATALOG, CATS, CATASORIUM, or CATNUM.
  205.  
  206. Please note that only the first
  207.  
  208. occurrence will be found and
  209.  
  210. unscratched.
  211.  
  212.   Press the '\' key to RUN Q&G
  213. \oad "q&g unscratcher",8
  214. UNSCRATCHER now.
  215.  
  216. =========< end of article >===========
  217.